package com.blackfish.style;

import java.util.List;

import com.blackfish.common.model.Style;

public class StyleService {
    private static final Style dao = new Style().dao();

    public String getNameById(int id) {
        return this.findById(id).getName();
    }

    public List<Style> findAll() {
        return dao.find("select * from style order by id asc");
    }

    public Style findById(int id) {
        return dao.findById(id);
    }

    public void deleteById(int id) {
        dao.deleteById(id);
    }

    public int getIdByName(String name) {
        return dao.findFirst("select * from style where name=\"" + name + "\"").getId();
    }

    public List<Style> getAllView() {
        return dao.find("select * from style");
    }



}
